package fr.esiag.isidis.pdsTeam.swing;

import java.awt.Dimension;
import java.awt.FlowLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class LabeledTextField extends JPanel {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 7314330066576989790L;

	public LabeledTextField(String label, int size) {
		this(label, size, 0);
	}
	
	public LabeledTextField(String label, int size, int labelWidth) {
		setLayout(new FlowLayout(FlowLayout.LEFT));
		JLabel l1 = new JLabel(label + " : ");
		if (labelWidth>0) l1.setPreferredSize(new Dimension(labelWidth, 20));
		JTextField t1 = new JTextField(size);
		
		add(l1);
		add(t1);

		//setBorder(BorderFactory.createLineBorder(Color.red));
	}
}
